package com.example.wxy.bbtapp.Startup;

import android.app.Application;

import org.xutils.DbManager;
import org.xutils.x;

/**
 * Created by yons on 2017/9/9.
 */

public class DbService {

    public static DbManager.DaoConfig daoConfig;
    public DbManager.DaoConfig getDaoConfig() {
        return daoConfig;
    }

    public static  DbManager getDB()
    {
        DbManager db = x.getDb(daoConfig);
        return db;
    }

    public static  void DBSetting(Application c) {

        x.Ext.init(c);//Xutils初始化

        daoConfig = new DbManager.DaoConfig()
                .setDbName("BBTDB")//创建数据库的名称
                .setDbVersion(2);//数据库版本号

        x.Ext.setDebug(true);
    }
}
